package com.ak.server.platform.mapper;

import com.ak.common.entity.system.DatasourceApplication;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 数据源关联子系统表
 */
@Mapper
public interface DatasourceApplicationMapper extends BaseMapper<DatasourceApplication> {

    /**
     * 根据租户编码删除子系统关联
     *
     * @param datasourceCode
     * @param appCode
     * @return
     */
    Boolean deleteByDatasourceCodeOrAppCode(@Param("datasourceCode") String datasourceCode, @Param("appCode") String appCode);

    /**
     * 添加租户关联子系统
     *
     * @param datasourceCode
     * @param appCodes
     * @return
     */
    int batchDatasourceApplication(@Param("datasourceCode") String datasourceCode, @Param("appCodes") List<String> appCodes);
}
